<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>数组的定义和使用</title>
	</head>
	<body>
		<script>
			//数组定义（数组的长度动态调整：数量不受限制，类型也不受限制，不建议）
			var a=new Array();
			a[0]=4;
			a[1]=5;
			//数组定义2
			var a2=new Array("a","b","c");
			a2[5]="g";
			//数组定义3
			var a3=["java","mysql","javascript"];
			a3[2]="c";
			
			console.log(a2[4]);
			console.log(a2[5]);
			console.log(a2.length);
			console.log(a3[2]);
			
			//遍历数组a2
			console.log("数组a2的元素：")
			for(var i=0;i<a2.length;i++){
				console.log(a2[i]);
			}
		</script>
	</body>
</html>
